package cash_access;

import mware_lib.IProxy;
import mware_lib.ISkeleton;
import mware_lib.ProxyCache;

public abstract class TransactionImplBase implements IProxy {
  public abstract void deposit(String accountID, double amount);
  public abstract void withdraw(String accountID, double amount) throws OverdraftException;
  public abstract double getBalance(String accountID);
  
  public static ProxyCache<TransactionProxy> cache = new ProxyCache<>(TransactionProxy.class);
  
  public static TransactionImplBase narrowCast(Object rawObjectRef) {
    return cache.returnCached(rawObjectRef);
  }
  
  @Override
  public ISkeleton getSkeleton() {
    return new TransactionSkeleton(this);
  }
}
